<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
// 
//  admin_statistics.php
//  www.6block.com
//  
//  Created by WillLee on 2011-06-21.
//  Copyright 2011 lishuzu. All rights reserved.
// 

class Admin_statistics extends CI_Controller {
	
	 function __construct()
	 {
		parent::__construct();
		$this->load->model('common/security_model');
		if($this->security_model->isAdminLogin() === FALSE){
         showmessage('请登录', 'admin/login/index', 3);
		}
		//加载缓存类
		$this->load->library('datacache');
		$this->category = $this->config->item('category');
	 }
	public function index()
	{
		$data = array();
		//加载主页缓存文件
		$cachefilename = APPPATH."cache/data_statistics.php";
		$cachefile = '';
		$cachetime = 7200;
		if(file_exists($cachefilename) && (filemtime($cachefilename) + $cachetime) > time()) {
		 	include_once($cachefilename);
			$data = $config['statistics'];
		 } else {
			$this->datacache->statistics();
			include_once($cachefilename);
			$data = $config['statistics'];
		}
		$this->load->template('admin/statistics_tpl', $data);
	}
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */